package cn.weiyan.dtx.tccdemo.bank2.controller;

import cn.weiyan.dtx.tccdemo.bank2.server.AccountInfoServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author misterWei
 * @create 2020年02月14号:18点23分
 * @mailbox mynameisweiyan@gmail.com
 */
@RestController
public class Bank2Controller {
    @Autowired
    AccountInfoServer accountInfoService;

    @GetMapping("/transfer")
    public Boolean transfer(@RequestParam("amount") Double amount){
        accountInfoService.updateAccountBalance("2",amount);
        return true;
    }
}
